package com.practice.entity;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.persistence.*;
import org.hibernate.annotations.Comment;
import java.time.LocalDateTime;

/**
 * desc
 *
 * @author: kayn
 * 2024-10-22 10:48
 **/
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class BaseDO {

    @Id
    @Comment("主键")
    @Column(name = "id")
    @TableId(type = IdType.INPUT)
    private String id;

    @Comment("创建人")
    @Column(name = "creator")
    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @Comment("修改人")
    @Column(name = "updater")
    @TableField(fill = FieldFill.UPDATE)
    private String updater;

    @Comment("创建时间")
    @Column(name = "create_time")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Comment("修改时间")
    @Column(name = "update_time")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @Comment("是否启用,默认为true")
    @Column(name = "enabled")
    private Boolean enabled = true;

    @TableLogic
    @Comment("是否删除,默认为false")
    @Column(name = "deleted")
    private Boolean deleted = false;

    @Comment("备注")
    @Column(name = "remark")
    private String remark;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
